﻿@model Cxuu.Models.AdminUser

@{
    ViewData["Title"] = "龙啸轩内容管理系统V5 登录";
}
<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="author" content="Cdeng">
    <title>@ViewData["Title"]</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="~/admin/css/login.css">
</head>

<body>
    <div class="login layui-anim layui-anim-up">
        <div class="message">@ViewData["Title"]</div>
        <div id="darkbannerwrap"></div>
        <div id="dvhide">
            <form method="post" class="layui-form">
                <input name="Username" placeholder="用户名" type="text" lay-verify="required" class="layui-input"
                       value="">
                <hr class="hr15">
                <input name="Password" lay-verify="required" placeholder="密码" type="password" class="layui-input"
                       value="">
                <hr class="hr15">
                <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
                <hr class="hr20">
            </form>
        </div>
    </div>

    <script src="~/lib/layui/layui.js" charset="utf-8"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form,layer = layui.layer,$ = layui.jquery;

            form.on('submit(login)', function (data) {
                data = data.field;
                if (data.username == '') {
                    layer.msg('用户名不能为空');
                    return false;
                }
                if (data.password == '') {
                    layer.msg('密码不能为空');
                    return false;
                }
                loading = layer.load(1, { shade: [0.1, '#fff'] });
                $.post('/Admin/Login/Login', data, function (res) {
                    layer.close(loading);
                    if (res.status == 1) {
                        layer.msg(res.msg, { icon: 1, time: 1000 }, function () {
                            location.href = '/Admin';// res.url;
                        });
                    }
                });
                return false;
            });
        });
    </script>
</body>
</html>